from typing import List, Tuple
import numpy as np
def calc_changing_rate(data_list: List[np.ndarray], time_interval: float = 0.33) -> np.ndarray:
    '''
    计算变化率
    Args:
        - data_list: List[np.ndarray]  输入数据列表
        - time_interval: float  时间间隔
    Return:
        - np.ndarray  输入数据列表的平均变化率
    '''
    data_length = len(data_list)
    if data_length < 2:
        raise ValueError("数据列表长度不足，无法计算变化率")

    if data_length <= 3:
        rate = np.zeros_like(data_list[0])
        for i in range(1, data_length):
            delta = data_list[i] - data_list[0]
            rate += delta / time_interval
        return rate / (data_length - 1)

    # 如果数据长度大于3，使用更复杂的计算方法
    half_length = data_length // 2
    data_list = np.stack(data_list,axis=0)
    rate = np.mean(data_list[half_length:half_length*2] - data_list[0:half_length], axis=0) / time_interval / half_length
    return rate
